import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/setting",
    name: "Setting",
    component: () => import("../views/Setting.vue"),
    redirect: "/setting/general",
    children: [
      {
        path: "general",
        name: "GeneralSettings",
        component: () => import("../views/components/general/general.vue"),
      },
      {
        path: "permissions",
        name: "PermissionsSettings",
        component: () => import("../views/components/permissions/permission.vue"),
      },
      {
        path: "models",
        name: "ModelsSettings",
        component: () => import("../views/components/models/model.vue"),
      },
      {
        path: "prompts",
        name: "PromptsSettings",
        component: () => import("../views/components/prompts/prompt.vue"),
      },
      {
        path: "vector",
        name: "VectorSettings",
        component: () => import("../views/components/vector/vector.vue"),
      },
      {
        path: "functions",
        name: "FunctionsSettings",
        component: () => import("../views/components/functions/function.vue"),
      },
      {
        path: "agents",
        name: "AgentsSettings",
        component: () => import("../views/components/agents/agent.vue"),
      },
      {
        path: "workflows",
        name: "WorkflowsSettings",
        component: () => import("../views/components/workflows/workflow.vue"),
      },
      {
        path: "api",
        name: "ApiSettings",
        component: () => import("../views/components/api/api.vue"),
      },
      {
        path: "monitor",
        name: "MonitorSettings",
        component: () => import("../views/components/monitor/monitor.vue"),
      },
    ],
  },
  {
    path: "/:pathMatch(.*)*",
    redirect: "/setting",
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
